package com.glory.wxmemsicpda.utils

import android.view.View
import android.view.animation.Animation
import android.view.animation.RotateAnimation

object AnimationUtils {
    fun arrowAnimation(view: View, how: Int) {
        if (how == 1) {
            val animation: Animation = RotateAnimation(
                0f, 180f, Animation.RELATIVE_TO_SELF,
                0.5f, Animation.RELATIVE_TO_SELF, 0.5f
            )
            animation.duration = 500
            animation.fillAfter = true
            view.startAnimation(animation)
        } else {
            val animationDismiss: Animation = RotateAnimation(
                180f, 0f, Animation.RELATIVE_TO_SELF,
                0.5f, Animation.RELATIVE_TO_SELF, 0.5f
            )
            animationDismiss.duration = 500
            animationDismiss.fillAfter = true
            view.startAnimation(animationDismiss)
        }
    }
}